﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucActionList.ascx.cs"
    Inherits="UserControl_ucActionList" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<link href="../css/content.css" rel="stylesheet" type="text/css" />

<script language="javascript" type="text/javascript">
    function UpdateParentsLogin() {
        tb_remove();
        window.parent.location = window.parent.location;
    }
</script>

<table id="tab" width="100%">
    <tr>
        <td style="width: 150px;">
            <asp:Label ID="Label6" runat="server" Text="Note Type"></asp:Label>
        </td>
        <td>
            <asp:Label ID="Label1" runat="server" Text="Requires ACTION"></asp:Label>
            <asp:RadioButton ID="rd1" runat="server" GroupName="checkbox" onclick="GetValueNoteType()" />
        </td>
        <td colspan="2">
            <asp:Label ID="Label2" runat="server" Text="No Action Required"></asp:Label>
            <asp:RadioButton ID="rd2" runat="server" GroupName="checkbox" onclick="GetValueNoteType()" />
        </td>
        <td>
            <asp:TextBox runat="server" ID="txt_NoteType" Width="120px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td style="width: 150px;">
            <asp:Label ID="Label8" runat="server" Text="Notes"></asp:Label>
        </td>
        <td colspan="3">
            <asp:TextBox ID="txtNotes" runat="server" TextMode="MultiLine" Width="435px"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*"
                ValidationGroup="save" ControlToValidate="txtNotes"></asp:RequiredFieldValidator>
        </td>
    </tr>
    <tr>
        <td style="width: 150px;">
            Status
        </td>
        <td>
            <asp:Label ID="Label3" runat="server" Text="NAR"></asp:Label>
            <asp:RadioButton ID="rd3" runat="server" GroupName="cb" onclick="GetValueNoteType()" />
            &nbsp;&nbsp;&nbsp;&nbsp;
        </td>
        <td>
            <asp:Label ID="Label4" runat="server" Text="To Be Actioned"></asp:Label>
            <asp:RadioButton ID="rd4" runat="server" GroupName="cb" onclick="GetValueNoteType()" />
            &nbsp;&nbsp;&nbsp;
        </td>
        <td>
            <asp:Label ID="Label5" runat="server" Text="Has been Actioned"></asp:Label>
            <asp:RadioButton ID="rd5" runat="server" GroupName="cb" onclick="GetValueNoteType()" />
        </td>
        <td>
            <asp:TextBox ID="txt_status" runat="server" Width="120px"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="Label10" runat="server" Text="Actioned By"></asp:Label>
        </td>
        <td colspan="3">
            <asp:TextBox ID="txt_ActionBy" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*"
                ControlToValidate="txt_ActionBy" ValidationGroup="save"></asp:RequiredFieldValidator>
            <asp:CheckBox ID="cb6" runat="server" />
        </td>
    </tr>
    <tr>
        <td colspan="3" align="center">
            <asp:Button ID="bt_save" runat="server" Text="Save" Height="30px" Width="57px" OnClick="bt_save_Click"
                ValidationGroup="save" />
        </td>
    </tr>
</table>
<table>
    <tr>
        <td colspan="3">
            <asp:GridView ID="grdJobNote" runat="server" AutoGenerateColumns="False" CssClass="grd">
                <Columns>
                    <asp:TemplateField HeaderText="Job ID">
                        <ItemTemplate>
                            <%# Eval("JobID")%>
                        </ItemTemplate>
                        <ItemStyle Width="30px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date Entered">
                        <ItemTemplate>
                            <%# (Convert.ToDateTime(Eval("DateEntered")).ToString("dd/MM/yyyy"))%>
                        </ItemTemplate>
                        <ItemStyle Width="130px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Date Action">
                        <ItemTemplate>
                            <%# (Convert.ToDateTime(DateTime.Now).ToString("dd/MM/yyyy"))%>
                        </ItemTemplate>
                        <ItemStyle Width="100px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Note Type">
                        <ItemTemplate>
                            <%# Eval("NoteType")%>
                        </ItemTemplate>
                        <ItemStyle Width="200px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Notes">
                        <ItemTemplate>
                            <%# Eval("Notes")%>
                        </ItemTemplate>
                        <ItemStyle Width="330px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Status Job Notes">
                        <ItemTemplate>
                            <%# Eval("StatusJobNote")%>
                        </ItemTemplate>
                        <ItemStyle Width="170px" VerticalAlign="Middle" HorizontalAlign="Center"></ItemStyle>
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                <HeaderStyle CssClass="grdHeader" />
                <EditRowStyle BackColor="#2461BF" />
                <AlternatingRowStyle CssClass="grdAlternateRow" />
                <PagerSettings PageButtonCount="6" />
                <RowStyle CssClass="grdRow" />
            </asp:GridView>
        </td>
    </tr>
</table>

<script language="javascript" type="text/javascript">
    function GetValueNoteType() {
        var rd1 = document.getElementById("<%=rd1.ClientID %>");
        var rd2 = document.getElementById("<%=rd2.ClientID %>");
        var rd3 = document.getElementById("<%=rd3.ClientID %>");
        var rd4 = document.getElementById("<%=rd4.ClientID %>");
        var rd5 = document.getElementById("<%=rd5.ClientID %>");

        var txtNoteType = document.getElementById("<%=txt_NoteType.ClientID %>");
        var txtStatus = document.getElementById("<%=txt_status.ClientID %>");
        if (rd1.checked == true) {
            txtNoteType.value = "Requires Action";
        }
        if (rd2.checked == true) {
            txtNoteType.value = "No Action Requires";
        }
        if (rd3.checked == true) {
            txtStatus.value = "NAR";
        }
        if (rd4.checked == true) {
            txtStatus.value = "To Be Actioned";
        }
        if (rd5.checked == true) {
            txtStatus.value = "Has been Actioned";
        }
    }
</script>

<p>
    &nbsp;</p>
<p>
    &nbsp;</p>
